<?php

namespace App\Admin\Filters;

class SystemMediaFilter extends Filter
{
    protected $simpleFilters = [
        'id' => 'in',
        'ext' => 'in',
        'filename' => ['like', '%?%'],
        'origin_filename' => ['like', '%?%'],
    ];

    protected $filters = [
        'category_id'
    ];

    protected function categoryId($val)
    {
        if (is_array($val)) {
            $this->builder->orWhereIn('category_id', $val);
        } else {
            $this->builder->where('category_id', $val);
        }
    }
}
